﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IO;
using BesAsm.Framework.ArcGisUtilities;

namespace BesAsm.Emgaats.Core.Commands
{
  public class ModelOpenCommand : SingleCommand
  {
    private string _modelPath;    
    private ModelIO _modelIO = new ModelIO();
    ArcGisUtils _arcUtils;

    public ModelOpenCommand(string modelPath)
    {      
      _arcUtils = new ArcGisUtils(ArcMap.Application);
      _modelPath = modelPath;      
    }

    #region IEmgaatsExtensionCommand Members

    public override void Execute()
    {
      base.Execute();
      // TODO: Check for dirty model here?
      Mediator.Model = _modelIO.Open(_modelPath);
    }    

    public override void Undo()
    {
      throw new NotImplementedException();
    }

    public override string Name
    {
      get { return "Open model"; }
    }

    public override string Description
    {
      get { return "Opens a model"; }
    }

    #endregion
  }
}
